<?php
App::uses('AttachmentBehavior', 'Uploader.Model/Behavior');

class Post extends AppModel {
	
// 	public $actsAs = array(
// 			'Uploader.Attachment' => array(
// 					'photo' => array(
// 							'nameCallback' => 'rename',
// 					)
// 			)
// 	);
	
	public $primaryKey = '_id';
	var $mongoSchema = array(
			'title' => array('type' => 'string'),
			'content' => array('type' => 'text'),
			'created' => array('type' => 'datetime'),
			'modified' => array('type' => 'datetime'),
			'likes' => array('type' => 'integer'),
			'category_id' => array('type' => 'string'),
			'tags' => array('type' => 'string')
			);
	
	public function rename($name, $file) {
		return md5(time());
	}
}
?>